//
//  MOAddressBookDetailViewCell.m
//  MobileOffice
//
//  Created by 冰冰 on 2019/6/10.
//  Copyright © 2019 com.idolmedia. All rights reserved.
//

#import "MOAddressBookDetailViewCell.h"

@interface MOAddressBookDetailViewCell ()

@property(nonatomic,strong)UILabel *nameLabel;

@property(nonatomic,strong)UILabel *valueLabel;

@end

@implementation MOAddressBookDetailViewCell

+(instancetype)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath
{
    //NSString *ID = [NSString stringWithFormat:@"Cell%ld%ld",(long)[indexPath section],(long)[indexPath row]];
    NSString *ID = @"MOAddressBookDetailViewCell";
    MOAddressBookDetailViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil){
        cell = [[MOAddressBookDetailViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        [cell creatView];
    }
    return cell;
}


-(void)creatView
{
    [self addSubview:self.nameLabel];
    [self addSubview:self.valueLabel];
}

-(void)setModel:(MOAddressBookDetailModel *)model
{
    self.nameLabel.text = model.nameStr;
    self.valueLabel.text = model.valueStr;
    
    self.valueLabel.textColor = model.valueColor;
}

#pragma mark -- 兰记载
-(UILabel *)nameLabel
{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(kWConversions(16), 0, 100, kHConversions(54))];
        _nameLabel.font = FONT_SIZE(15);
        _nameLabel.textColor = KBlackColor_2A2A2A;
    }
    return _nameLabel;
}

-(UILabel *)valueLabel
{
    if (!_valueLabel) {
        _valueLabel = [[UILabel alloc]initWithFrame:CGRectMake(_nameLabel.right, 0, SCREEN_WIDTH - _nameLabel.width - kWConversions(16) * 2, kHConversions(54))];
        _valueLabel.font = FONT_SIZE(15);
    }
    return _valueLabel;
}


@end
